package com.hzz.dao.patrol;

import com.hzz.framework.dao.IBaseDao;
import com.hzz.framework.entity.IEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 巡查计划管理 数据库处理接口类。
 */
@Mapper
public interface IInspectionPlanDao extends IBaseDao {
    
    /**
     * 判断是否存在
     */
    @Override
    @Select("select IFNULL(count(0),0) as count from inspection_plan where  id = #{id} ")
    int isDataExist(IEntity entity) throws Exception;
    
    /**
     * 逻辑删除
     */
    @Override
    @Update("update inspection_plan set  date_updated=now(), del_flag=1 where  id = #{id} ")
    int deleteById(IEntity entity) throws Exception;
    
    /**
     * 根据主键 物理删除
     */
    @Override
    @Delete("delete from inspection_plan where  id = #{id} ")
    int deleteByPrimaryKey(IEntity entity) throws Exception;
    
}